package kr.hkit.powerjava.chapter06.work;

import java.util.Scanner;

public class prog5 {
	public static void main(String[] args) {
		int x;
		double a,b;
		
		Scanner in=new Scanner(System.in);
		
		System.out.print("x값 입력: ");
		x=in.nextInt();
		
		if(x<=0)
			System.out.println((x*x*x)-(9*x)+2);
		else
			System.out.println(7*x+2);
	}

}
